package Cn.Sarkar.MMS.DataBaseDefinations.Independent.Wallet

import Cn.Sarkar.EntityDream.CoreEngine.RDBMS.Core.Extensions.*
import Cn.Sarkar.MMS.DataBaseDefinations.Additional.Descriptions
import Cn.Sarkar.MMS.DataBaseDefinations.Independent.Accounts
import Cn.Sarkar.MMS.DataBaseDefinations.Independent.Applications
import Cn.Sarkar.Entities.Common.Table

object Wallets : Table("Wallet") {
    override var Comment: String = "چىقىمدان"
    val AccountID = intColumn("AccountID") reference Accounts.ID comment "ھىسابات"
    val Integral = floatColumn("Integral") comment "جۇغلانما نومۇرى"
    val Money = floatColumn("Money") comment "پۇلى"
    val MemberShipLevelID = intColumn("MemberShipLevelID") reference MemberShipLevels.ID comment "ئەزا دەرىجىسى"
    val SupportLevelUpgrade = booleanColumn("SupportLevelUpgrade") comment "دەرىجە ئاپتوماتىك يىڭىلىنىشنى قوللامدۇ"
    val LevelUpgradedTime = dateTimeColumn("LevelUpgradedTime") comment "ئەزالارنىڭ دەرىجىسى ئۆستۈرۈلگەن ۋاقتى"
    val TimeOutDaysIfUnUsed = intColumn("TimeOutDaysIfUnUsed") comment "كارتىنى ئىشلىتىپ باقمىغىلى قانچە كۈن بولغاندا كارتا ئەمەلدىن قالسا بولىدۇ؟"
    val ToNowTotalIntegralCount = floatColumn("ToNowTotalIntegralCount") comment "ھازىرغىچە بولغان ئومومى جۇغلانما نومۇرى"
    val ToNowTotalMoney = floatColumn("ToNowTotalMoney") comment "ھازىرغىچە بولغان ئومومى پۇلى"
    val ToNowUseCount = intColumn("ToNowUseCount") comment "ھازىرغىچە ئىشلەتكەن قىتىم سانى"
//    val Histories: MutableList<IChangeHistory>
    val DescriptionID = intColumn("DescriptionID") reference Descriptions.ID
    val ICCardID = stringColumn("ICCardID") size 16 isN false
    val MagnetCardID= stringColumn("MagmetCardID") size 16 isN false
    val RFIDCardID= stringColumn("RFIDCardID") size 16 isN false
    val CreditLevel = intColumn("CreditLevel") comment "ئىشەنىچ دەرىجىسى"

    init {
        index(Money, Integral, ToNowUseCount)
        index(ICCardID, MagnetCardID, RFIDCardID)
        index(CreditLevel)
    }

    override val CATEGORY: Int = 17
}